package com.zycfc.zsf.boot.core.web.data;

import java.io.*;
import io.swagger.annotations.*;

@ApiModel(value = "Page", description = "\u8fd4\u56de\u5206\u9875\u6570\u636e\u7c7b\u578b")
public class Page implements Serializable
{
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("\u5f53\u524d\u9875\u7801")
    private int current;
    @ApiModelProperty("\u6bcf\u9875\u6761\u6570")
    private int pageSize;
    @ApiModelProperty("\u603b \u6761\u6570")
    private long total;
    @ApiModelProperty("\u603b\u9875\u6570")
    private long pages;
    
    public Page() {
    }
    
    public Page(final int current, final int pageSize) {
        this.current = current;
        this.pageSize = pageSize;
    }
    
    public Page(final int current, final int pageSize, final long total, final long pages) {
        this.current = current;
        this.pageSize = pageSize;
        this.pages = pages;
        this.total = total;
    }
    
    public Page(final long total) {
        this.total = total;
    }
    
    public int getCurrent() {
        return this.current;
    }
    
    public int getPageSize() {
        return this.pageSize;
    }
    
    public long getTotal() {
        return this.total;
    }
    
    public long getPages() {
        return this.pages;
    }
    
    public void setCurrent(final int current) {
        this.current = current;
    }
    
    public void setPageSize(final int pageSize) {
        this.pageSize = pageSize;
    }
    
    public void setTotal(final long total) {
        this.total = total;
    }
    
    public void setPages(final long pages) {
        this.pages = pages;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof Page)) {
            return false;
        }
        final Page other = (Page)o;
        return other.canEqual(this) && this.getCurrent() == other.getCurrent() && this.getPageSize() == other.getPageSize() && this.getTotal() == other.getTotal() && this.getPages() == other.getPages();
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof Page;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getCurrent();
        result = result * 59 + this.getPageSize();
        final long $total = this.getTotal();
        result = result * 59 + (int)($total >>> 32 ^ $total);
        final long $pages = this.getPages();
        result = result * 59 + (int)($pages >>> 32 ^ $pages);
        return result;
    }
    
    @Override
    public String toString() {
        return "Page(current=" + this.getCurrent() + ", pageSize=" + this.getPageSize() + ", total=" + this.getTotal() + ", pages=" + this.getPages() + ")";
    }
}
